package com.tedu.bill.demo4;

import javax.tools.FileObject;
import java.io.*;

/**
 * Author：毕龙
 * Date: 2024/5/28 9:24
 */
public class TestFile6 {
    public static void main(String[] args) throws IOException {
        //创键输出流对象
        OutputStream outputStream = new FileOutputStream("day14/src/object.txt",true);

        //创建对象流
        ObjectOutput objectOutputStream = new ObjectOutputStream(outputStream);

        //创建对象
        User user = new User("泽豪", "478478");
        //写对象
        objectOutputStream.writeObject(user);

        //关闭流
        objectOutputStream.close();
        outputStream.close();


    }
}
